import React, { Component } from 'react'

export class Left extends Component {
  render() {
    const {list, leftid, onchangeleft}=this.props
    return (
      <div className='left'>
        {this.props.children}
        <ul>
        { list.length  ?   list.map((item)=>{
          return <li className={  leftid===item.id ? 'on'   :''}  key={item.id}  onClick={
            ()=>{
              onchangeleft(item.id)
            }
          }>{item.title}</li>
        }):'暂无数据' }

        
        </ul>
      </div>
    )
  }
}

export default Left